
#include <iostream>
#include <cstring>
using namespace std;

class Human {
	public:
		Human( int age=0, const char* name="wuming" ) : m_age( age ), m_name( name ){
		
		}
	private:
		int m_age;
		string m_name;
		friend ostream& operator<<( ostream& os, const Human& that );
		friend istream& operator>>( istream& is, Human& that );
};

ostream& operator<<( ostream& os, const Human& that ) {
	os << "xingming : " << that.m_name << ", nianling : " << that.m_age;
	return os;
}

istream& operator>>( istream& is, Human& that ) {
	is >> that.m_name >> that.m_age;
	return is;
}

// designer
// ------------------------------------------------------------------
// user

int main( void ) { 
	Human a( 22, "zhangfei" ), b( 24, "zhaoyun" );
        const Human c( 18, "lily" ), d( 50, "guaangjun" );
	
	cout << a << endl;
	cout << b << endl;
	cout << Human( 45, "laohuang" ) << endl;

	cin >> a;
	cout << a << endl;

	return 0;
}

